package com.example.tables.dao;

import com.example.tables.bean.TableABean;
import com.example.tables.bean.TableBBean;
import com.example.tables.bean.TableCBean;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TableCDao {

    @Select("select * from tablec where b like #{b}")
    List<TableCBean> getData(@Param("b")String b);

    @Select("select * from tablea where aa like 1")
    List<TableABean> numaainTa();

    @Select("select * from tablea where bb like 1")
    List<TableABean> numbbinTa();

    @Select("select * from tablea where cc like 1")
    List<TableABean> numccinTa();

    @Select("select * from tableb where aaRight like 1")
    List<TableBBean> numaRight();

    @Select("select * from tableb where bbRight like 1")
    List<TableBBean> numbRight();

    @Select("select * from tableb where ccRight like 1")
    List<TableBBean> numcRight();

    @Select("select * from tableb where aa like 1")
    List<TableBBean> numaainTb();

    @Select("select * from tableb where bb like 1")
    List<TableBBean> numbbinTb();

    @Select("select * from tableb where cc like 1")
    List<TableBBean> numccinTb();

    @Select("select * from tablea where ee like 1")
    List<TableABean> numeeinTa();

    @Select("select * from tableb where eeRight like 1")
    List<TableBBean> numeRight();

    @Select("select * from tablea where dd like 1")
    List<TableABean> numddinTa();

    @Select("select * from tableb where ddRight like 1")
    List<TableBBean> numdRight();

    @Insert("insert into tablec(b,aaS,bbS,ccS,aaA,bbA,ccA,aaSS,aaC,ddS ) values (#{b}, #{aaS},#{bbS},#{ccS},#{aaA},#{bbA},#{ccA},#{aaSS},#{aaC},#{ddS})")
    int calculate(TableCBean tableCBean);


    @Select("select * from tablec")
    List<TableCBean> getAll();


}
